package com.vhall.component.controller.rbac;


import com.vhall.component.controller.rbac.facade.RbacActionFacade;
import com.vhall.component.entity.rbac.vo.ActionAddReqVO;
import com.vhall.component.entity.rbac.vo.ActionDeleteReqVO;
import com.vhall.component.entity.rbac.vo.ActionEditReqVO;
import com.vhall.component.entity.rbac.vo.ActionsVO;
import com.vhall.component.framework.common.annotation.VhallComponent;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import com.vhall.component.service.rbac.RbacActionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;

/**
 * @author dalong
 * @date 2021-05-12 21:06
 */
@Api(tags = "RbacActionController", value = "后台权限")
@VhallComponent
@Slf4j
@TokenAuth
public class RbacActionController implements RbacActionFacade {

    @Autowired
    private RbacActionService actionService;

    @ApiOperation("操作-添加")
    @Override
    public ActionsVO add(@Validated ActionAddReqVO reqVO) {
        return actionService.add(reqVO);
    }

    @ApiOperation("操作-删除")
    @Override
    public Boolean delete(@Validated ActionDeleteReqVO reqVO) {
        return actionService.batchDelete(reqVO);
    }

    @ApiOperation("操作-编辑")
    @Override
    public Boolean edit(@Validated ActionEditReqVO reqVO) {
        return actionService.update(reqVO);
    }


}
